package com.loongtech.bi.entity.system;

import com.loongtech.core.gen.GenInnerK;
import com.loongtech.core.jpa.entity.EntityIntAuto;
import com.loongtech.core.util.Time;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

@Entity
@Table(name = "system_operate_log")
@GenInnerK
public class EntitySystemLog extends EntityIntAuto {
	private static final long serialVersionUID = 1L;
	@Column(columnDefinition="varchar(255) NOT NULL default ''")
	private String operator;											// operator
    @Column(columnDefinition = "varchar(255) default ''")
    private String gameId ;
    @Transient
    private String gameName ;
    @Transient
    private String actionName ;
	@Column(columnDefinition="varchar(255) NOT NULL default ''")
	private String action = "";							// 操作
	@Column(columnDefinition = "DATETIME", nullable = false)
	private Date operTime = new Date(Time.currentTime());

	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public Date getOperTime() {
		return operTime;
	}

	public void setOperTime(Date time) {
		this.operTime = time;
	}

    public String getGameId() {
        return gameId;
    }

    public void setGameId(String gameId) {
        this.gameId = gameId;
    }

    public String getGameName() {
        return gameName;
    }

    public void setGameName(String gameName) {
        this.gameName = gameName;
    }

    public String getActionName() {
        return actionName;
    }

    public void setActionName(String actionName) {
        this.actionName = actionName;
    }

    @Override
	public String toString() {
		return "EntitySystemLog [operator=" + operator + ", action=" + action + ", operTime=" + operTime + "]";
	}

	public static class K {
		public static final String operator = "operator";
		public static final String action = "action";
		public static final String operTime = "operTime";
		public static final String id = "id";
		public static final String version = "version";
		
		//operator, action, operTime, id, version, 
		public static java.util.List<String> toList() {
			java.util.List<String> list = new java.util.ArrayList<>();
			list.add(operator);
			list.add(action);
			list.add(operTime);
			list.add(id);
			list.add(version);
			return list;
		}
	}
}